\hypertarget{queue_8h}{}\section{lib/queue.h File Reference}
\label{queue_8h}\index{lib/queue.\+h@{lib/queue.\+h}}


Ring buffer code.  


\subsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \hyperlink{structqueue__t}{queue\+\_\+t}
\begin{DoxyCompactList}\small\item\em queue structure \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \hyperlink{queue_8h_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE}
\item 
\#define \hyperlink{queue_8h_a991bfb3afb6f6913d6b216c7d9a74810}{Q\+U\+E\+U\+E\+\_\+\+O\+V\+E\+R\+R\+UN}~1
\item 
\#define \hyperlink{queue_8h_a140a823cbbec938f79f3698c4e433d6c}{Q\+U\+E\+U\+E\+\_\+\+E\+OL}~2
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{structqueue__t}{queue\+\_\+t} $\ast$ \hyperlink{queue_8h_a9bdc538e328e481eb5f5b52ba10d36b9}{queue\+\_\+new} (\hyperlink{cpu_8h_aea0c7eab1ce1eebb4e879ef4e23c16ee}{size\+\_\+t} size)
\begin{DoxyCompactList}\small\item\em Create a ring buffer of a given size. \end{DoxyCompactList}\item 
void \hyperlink{queue_8h_a6bac5e705b44fd0b677b9ff9b3a19a23}{queue\+\_\+del} (\hyperlink{structqueue__t}{queue\+\_\+t} $\ast$q)
\begin{DoxyCompactList}\small\item\em Delete a ring buffer and free memory. \end{DoxyCompactList}\item 
void \hyperlink{queue_8h_af654fe25b559b820fabf86f0a685e57a}{queue\+\_\+flush} (\hyperlink{structqueue__t}{queue\+\_\+t} $\ast$q)
\begin{DoxyCompactList}\small\item\em Flush ring buffer. \end{DoxyCompactList}\item 
\hyperlink{cpu_8h_aea0c7eab1ce1eebb4e879ef4e23c16ee}{size\+\_\+t} \hyperlink{queue_8h_a3d73971b8454e29803ddc0763a2413c6}{queue\+\_\+used} (\hyperlink{structqueue__t}{queue\+\_\+t} $\ast$q)
\begin{DoxyCompactList}\small\item\em Find the number of bytes used by the ring buffer. \end{DoxyCompactList}\item 
\hyperlink{cpu_8h_aea0c7eab1ce1eebb4e879ef4e23c16ee}{size\+\_\+t} \hyperlink{queue_8h_a5c47c1a42dc50ea36aab9629c4378b37}{queue\+\_\+empty} (\hyperlink{structqueue__t}{queue\+\_\+t} $\ast$q)
\begin{DoxyCompactList}\small\item\em Is the ring buffer empty ? \end{DoxyCompactList}\item 
\hyperlink{cpu_8h_aea0c7eab1ce1eebb4e879ef4e23c16ee}{size\+\_\+t} \hyperlink{queue_8h_a6309ae001025faf270eb01c0f78c2cba}{queue\+\_\+space} (\hyperlink{structqueue__t}{queue\+\_\+t} $\ast$q)
\begin{DoxyCompactList}\small\item\em Find the amount of free space remaining in the ring buffer. \end{DoxyCompactList}\item 
\hyperlink{cpu_8h_aea0c7eab1ce1eebb4e879ef4e23c16ee}{size\+\_\+t} \hyperlink{queue_8h_ace76ddf1f8e6b6b0d836ff6ac0255311}{queue\+\_\+full} (\hyperlink{structqueue__t}{queue\+\_\+t} $\ast$q)
\begin{DoxyCompactList}\small\item\em Is the ring buffer full ? \end{DoxyCompactList}\item 
\hyperlink{cpu_8h_aea0c7eab1ce1eebb4e879ef4e23c16ee}{size\+\_\+t} \hyperlink{queue_8h_a69e47095291acc128fa52906bfe5cebf}{queue\+\_\+push\+\_\+buffer} (\hyperlink{structqueue__t}{queue\+\_\+t} $\ast$q, \hyperlink{send_8c_aba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t} $\ast$src, \hyperlink{cpu_8h_aea0c7eab1ce1eebb4e879ef4e23c16ee}{size\+\_\+t} size)
\begin{DoxyCompactList}\small\item\em Add a data buffer to the ring buffer Note\+: This function does not wait/block util there is enough free space to meet the request. So you must check that the return value matches the size. \end{DoxyCompactList}\item 
\hyperlink{cpu_8h_aea0c7eab1ce1eebb4e879ef4e23c16ee}{size\+\_\+t} \hyperlink{queue_8h_aff31d44fd9a36c7e59740485c6142f4f}{queue\+\_\+pop\+\_\+buffer} (\hyperlink{structqueue__t}{queue\+\_\+t} $\ast$q, \hyperlink{send_8c_aba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t} $\ast$\hyperlink{time_8c_a5a388b2bb2a2a9914c7d68ed3d09f7e9}{dst}, \hyperlink{cpu_8h_aea0c7eab1ce1eebb4e879ef4e23c16ee}{size\+\_\+t} size)
\begin{DoxyCompactList}\small\item\em Get a data buffer from the ring buffer. Note\+: This function does not wait/block until there is enough data to fill the request. So you must check that the return value matches the size. \end{DoxyCompactList}\item 
int \hyperlink{queue_8h_a918e9bab1d67104964e167722a4d3793}{queue\+\_\+pushc} (\hyperlink{structqueue__t}{queue\+\_\+t} $\ast$q, \hyperlink{send_8c_aba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t} c)
\begin{DoxyCompactList}\small\item\em Add a byte to the ring buffer Note\+: This function does not wait/block util there is enough free space to meet the request. We assume you check \hyperlink{queue_8c_ace76ddf1f8e6b6b0d836ff6ac0255311}{queue\+\_\+full()} before calling this function! Otherwise you must check that the return value matches 1. \end{DoxyCompactList}\item 
int \hyperlink{queue_8h_adc939b887e06d9c92507c37fa6a87cb8}{queue\+\_\+popc} (\hyperlink{structqueue__t}{queue\+\_\+t} $\ast$q)
\begin{DoxyCompactList}\small\item\em Remove a byte from the ring buffer Note\+: This function does not wait/block util there is data to meet the request. We assume you check \hyperlink{queue_8c_a5c47c1a42dc50ea36aab9629c4378b37}{queue\+\_\+empty()} before calling this function! \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Ring buffer code. 

\begin{DoxyParagraph}{Copyright \copyright{} 2015 Mike Gore, G\+PL License}

\end{DoxyParagraph}
\begin{DoxyParagraph}{You are free to use this code under the terms of G\+PL}
Please retain a copy of this notice in any code you use it in.
\end{DoxyParagraph}
This is free software\+: you can redistribute it and/or modify it under the terms of the G\+NU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This software is distributed in the hope that it will be useful, but W\+I\+T\+H\+O\+UT A\+NY W\+A\+R\+R\+A\+N\+TY; without even the implied warranty of M\+E\+R\+C\+H\+A\+N\+T\+A\+B\+I\+L\+I\+TY or F\+I\+T\+N\+E\+SS F\+OR A P\+A\+R\+T\+I\+C\+U\+L\+AR P\+U\+R\+P\+O\+SE. See the G\+NU General Public License for more details.

You should have received a copy of the G\+NU General Public License along with this program. If not, see \href{http://www.gnu.org/licenses/}{\tt http\+://www.\+gnu.\+org/licenses/}. 

\subsection{Macro Definition Documentation}
\index{queue.\+h@{queue.\+h}!M\+E\+M\+S\+P\+A\+CE@{M\+E\+M\+S\+P\+A\+CE}}
\index{M\+E\+M\+S\+P\+A\+CE@{M\+E\+M\+S\+P\+A\+CE}!queue.\+h@{queue.\+h}}
\subsubsection[{\texorpdfstring{M\+E\+M\+S\+P\+A\+CE}{MEMSPACE}}]{\setlength{\rightskip}{0pt plus 5cm}\#define M\+E\+M\+S\+P\+A\+CE}\hypertarget{queue_8h_ad0fe97585b8891f5e4f2b9a6426330a4}{}\label{queue_8h_ad0fe97585b8891f5e4f2b9a6426330a4}


Definition at line 29 of file queue.\+h.

\index{queue.\+h@{queue.\+h}!Q\+U\+E\+U\+E\+\_\+\+E\+OL@{Q\+U\+E\+U\+E\+\_\+\+E\+OL}}
\index{Q\+U\+E\+U\+E\+\_\+\+E\+OL@{Q\+U\+E\+U\+E\+\_\+\+E\+OL}!queue.\+h@{queue.\+h}}
\subsubsection[{\texorpdfstring{Q\+U\+E\+U\+E\+\_\+\+E\+OL}{QUEUE_EOL}}]{\setlength{\rightskip}{0pt plus 5cm}\#define Q\+U\+E\+U\+E\+\_\+\+E\+OL~2}\hypertarget{queue_8h_a140a823cbbec938f79f3698c4e433d6c}{}\label{queue_8h_a140a823cbbec938f79f3698c4e433d6c}


Definition at line 33 of file queue.\+h.



Referenced by kbhiteol(), queue\+\_\+popc(), and queue\+\_\+pushc().

\index{queue.\+h@{queue.\+h}!Q\+U\+E\+U\+E\+\_\+\+O\+V\+E\+R\+R\+UN@{Q\+U\+E\+U\+E\+\_\+\+O\+V\+E\+R\+R\+UN}}
\index{Q\+U\+E\+U\+E\+\_\+\+O\+V\+E\+R\+R\+UN@{Q\+U\+E\+U\+E\+\_\+\+O\+V\+E\+R\+R\+UN}!queue.\+h@{queue.\+h}}
\subsubsection[{\texorpdfstring{Q\+U\+E\+U\+E\+\_\+\+O\+V\+E\+R\+R\+UN}{QUEUE_OVERRUN}}]{\setlength{\rightskip}{0pt plus 5cm}\#define Q\+U\+E\+U\+E\+\_\+\+O\+V\+E\+R\+R\+UN~1}\hypertarget{queue_8h_a991bfb3afb6f6913d6b216c7d9a74810}{}\label{queue_8h_a991bfb3afb6f6913d6b216c7d9a74810}


Definition at line 32 of file queue.\+h.



Referenced by queue\+\_\+pushc().



\subsection{Function Documentation}
\index{queue.\+h@{queue.\+h}!queue\+\_\+del@{queue\+\_\+del}}
\index{queue\+\_\+del@{queue\+\_\+del}!queue.\+h@{queue.\+h}}
\subsubsection[{\texorpdfstring{queue\+\_\+del(queue\+\_\+t $\ast$q)}{queue_del(queue_t *q)}}]{\setlength{\rightskip}{0pt plus 5cm}void queue\+\_\+del (
\begin{DoxyParamCaption}
\item[{{\bf queue\+\_\+t} $\ast$}]{q}
\end{DoxyParamCaption}
)}\hypertarget{queue_8h_a6bac5e705b44fd0b677b9ff9b3a19a23}{}\label{queue_8h_a6bac5e705b44fd0b677b9ff9b3a19a23}


Delete a ring buffer and free memory. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em $\ast$q} & ring buffer pointer \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
void 
\end{DoxyReturn}


Definition at line 62 of file queue.\+c.

\index{queue.\+h@{queue.\+h}!queue\+\_\+empty@{queue\+\_\+empty}}
\index{queue\+\_\+empty@{queue\+\_\+empty}!queue.\+h@{queue.\+h}}
\subsubsection[{\texorpdfstring{queue\+\_\+empty(queue\+\_\+t $\ast$q)}{queue_empty(queue_t *q)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf size\+\_\+t} queue\+\_\+empty (
\begin{DoxyParamCaption}
\item[{{\bf queue\+\_\+t} $\ast$}]{q}
\end{DoxyParamCaption}
)}\hypertarget{queue_8h_a5c47c1a42dc50ea36aab9629c4378b37}{}\label{queue_8h_a5c47c1a42dc50ea36aab9629c4378b37}


Is the ring buffer empty ? 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em $\ast$q} & ring buffer pointer \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
1 if empty, 0 otherwise 
\end{DoxyReturn}


Definition at line 114 of file queue.\+c.



Referenced by kbhit(), kbhiteol(), and uart\+\_\+flush().

\index{queue.\+h@{queue.\+h}!queue\+\_\+flush@{queue\+\_\+flush}}
\index{queue\+\_\+flush@{queue\+\_\+flush}!queue.\+h@{queue.\+h}}
\subsubsection[{\texorpdfstring{queue\+\_\+flush(queue\+\_\+t $\ast$q)}{queue_flush(queue_t *q)}}]{\setlength{\rightskip}{0pt plus 5cm}void queue\+\_\+flush (
\begin{DoxyParamCaption}
\item[{{\bf queue\+\_\+t} $\ast$}]{q}
\end{DoxyParamCaption}
)}\hypertarget{queue_8h_af654fe25b559b820fabf86f0a685e57a}{}\label{queue_8h_af654fe25b559b820fabf86f0a685e57a}


Flush ring buffer. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em $\ast$q} & ring buffer pointer \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
void 
\end{DoxyReturn}


Definition at line 87 of file queue.\+c.

\index{queue.\+h@{queue.\+h}!queue\+\_\+full@{queue\+\_\+full}}
\index{queue\+\_\+full@{queue\+\_\+full}!queue.\+h@{queue.\+h}}
\subsubsection[{\texorpdfstring{queue\+\_\+full(queue\+\_\+t $\ast$q)}{queue_full(queue_t *q)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf size\+\_\+t} queue\+\_\+full (
\begin{DoxyParamCaption}
\item[{{\bf queue\+\_\+t} $\ast$}]{q}
\end{DoxyParamCaption}
)}\hypertarget{queue_8h_ace76ddf1f8e6b6b0d836ff6ac0255311}{}\label{queue_8h_ace76ddf1f8e6b6b0d836ff6ac0255311}


Is the ring buffer full ? 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em $\ast$q} & ring buffer pointer \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
1 if full, 0 otherwise 
\end{DoxyReturn}


Definition at line 140 of file queue.\+c.



Referenced by uart\+\_\+flush().

\index{queue.\+h@{queue.\+h}!queue\+\_\+new@{queue\+\_\+new}}
\index{queue\+\_\+new@{queue\+\_\+new}!queue.\+h@{queue.\+h}}
\subsubsection[{\texorpdfstring{queue\+\_\+new(size\+\_\+t size)}{queue_new(size_t size)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf queue\+\_\+t}$\ast$ queue\+\_\+new (
\begin{DoxyParamCaption}
\item[{{\bf size\+\_\+t}}]{size}
\end{DoxyParamCaption}
)}\hypertarget{queue_8h_a9bdc538e328e481eb5f5b52ba10d36b9}{}\label{queue_8h_a9bdc538e328e481eb5f5b52ba10d36b9}


Create a ring buffer of a given size. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em size} & size of rin buffer \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
popinter to ring buffer structure 
\end{DoxyReturn}


Definition at line 38 of file queue.\+c.

\index{queue.\+h@{queue.\+h}!queue\+\_\+pop\+\_\+buffer@{queue\+\_\+pop\+\_\+buffer}}
\index{queue\+\_\+pop\+\_\+buffer@{queue\+\_\+pop\+\_\+buffer}!queue.\+h@{queue.\+h}}
\subsubsection[{\texorpdfstring{queue\+\_\+pop\+\_\+buffer(queue\+\_\+t $\ast$q, uint8\+\_\+t $\ast$dst, size\+\_\+t size)}{queue_pop_buffer(queue_t *q, uint8_t *dst, size_t size)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf size\+\_\+t} queue\+\_\+pop\+\_\+buffer (
\begin{DoxyParamCaption}
\item[{{\bf queue\+\_\+t} $\ast$}]{q, }
\item[{{\bf uint8\+\_\+t} $\ast$}]{dst, }
\item[{{\bf size\+\_\+t}}]{size}
\end{DoxyParamCaption}
)}\hypertarget{queue_8h_aff31d44fd9a36c7e59740485c6142f4f}{}\label{queue_8h_aff31d44fd9a36c7e59740485c6142f4f}


Get a data buffer from the ring buffer. Note\+: This function does not wait/block until there is enough data to fill the request. So you must check that the return value matches the size. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em $\ast$q} & ring buffer pointer \\
\hline
\mbox{\tt in}  & {\em $\ast$dst} & outout buffer \\
\hline
\mbox{\tt in}  & {\em size} & size of input buffer \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
number of bytes actually added to the buffer -\/ may not be size! 
\end{DoxyReturn}


Definition at line 186 of file queue.\+c.

\index{queue.\+h@{queue.\+h}!queue\+\_\+popc@{queue\+\_\+popc}}
\index{queue\+\_\+popc@{queue\+\_\+popc}!queue.\+h@{queue.\+h}}
\subsubsection[{\texorpdfstring{queue\+\_\+popc(queue\+\_\+t $\ast$q)}{queue_popc(queue_t *q)}}]{\setlength{\rightskip}{0pt plus 5cm}int queue\+\_\+popc (
\begin{DoxyParamCaption}
\item[{{\bf queue\+\_\+t} $\ast$}]{q}
\end{DoxyParamCaption}
)}\hypertarget{queue_8h_adc939b887e06d9c92507c37fa6a87cb8}{}\label{queue_8h_adc939b887e06d9c92507c37fa6a87cb8}


Remove a byte from the ring buffer Note\+: This function does not wait/block util there is data to meet the request. We assume you check \hyperlink{queue_8c_a5c47c1a42dc50ea36aab9629c4378b37}{queue\+\_\+empty()} before calling this function! 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em $\ast$q} & ring buffer pointer \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
byte , or 0 if ring buffer was empty (user error) 
\end{DoxyReturn}


Definition at line 244 of file queue.\+c.



Referenced by uart\+\_\+flush().

\index{queue.\+h@{queue.\+h}!queue\+\_\+push\+\_\+buffer@{queue\+\_\+push\+\_\+buffer}}
\index{queue\+\_\+push\+\_\+buffer@{queue\+\_\+push\+\_\+buffer}!queue.\+h@{queue.\+h}}
\subsubsection[{\texorpdfstring{queue\+\_\+push\+\_\+buffer(queue\+\_\+t $\ast$q, uint8\+\_\+t $\ast$src, size\+\_\+t size)}{queue_push_buffer(queue_t *q, uint8_t *src, size_t size)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf size\+\_\+t} queue\+\_\+push\+\_\+buffer (
\begin{DoxyParamCaption}
\item[{{\bf queue\+\_\+t} $\ast$}]{q, }
\item[{{\bf uint8\+\_\+t} $\ast$}]{src, }
\item[{{\bf size\+\_\+t}}]{size}
\end{DoxyParamCaption}
)}\hypertarget{queue_8h_a69e47095291acc128fa52906bfe5cebf}{}\label{queue_8h_a69e47095291acc128fa52906bfe5cebf}


Add a data buffer to the ring buffer Note\+: This function does not wait/block util there is enough free space to meet the request. So you must check that the return value matches the size. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em $\ast$q} & ring buffer pointer \\
\hline
\mbox{\tt in}  & {\em $\ast$src} & input buffer \\
\hline
\mbox{\tt in}  & {\em size} & size of input buffer \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
number of bytes actually added to the buffer -\/ may not be size! 
\end{DoxyReturn}


Definition at line 157 of file queue.\+c.

\index{queue.\+h@{queue.\+h}!queue\+\_\+pushc@{queue\+\_\+pushc}}
\index{queue\+\_\+pushc@{queue\+\_\+pushc}!queue.\+h@{queue.\+h}}
\subsubsection[{\texorpdfstring{queue\+\_\+pushc(queue\+\_\+t $\ast$q, uint8\+\_\+t c)}{queue_pushc(queue_t *q, uint8_t c)}}]{\setlength{\rightskip}{0pt plus 5cm}int queue\+\_\+pushc (
\begin{DoxyParamCaption}
\item[{{\bf queue\+\_\+t} $\ast$}]{q, }
\item[{{\bf uint8\+\_\+t}}]{c}
\end{DoxyParamCaption}
)}\hypertarget{queue_8h_a918e9bab1d67104964e167722a4d3793}{}\label{queue_8h_a918e9bab1d67104964e167722a4d3793}


Add a byte to the ring buffer Note\+: This function does not wait/block util there is enough free space to meet the request. We assume you check \hyperlink{queue_8c_ace76ddf1f8e6b6b0d836ff6ac0255311}{queue\+\_\+full()} before calling this function! Otherwise you must check that the return value matches 1. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em $\ast$q} & ring buffer pointer \\
\hline
\mbox{\tt in}  & {\em c} & vyte to add \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
number of bytes actually added to the buffer -\/ may not be 1! 
\end{DoxyReturn}


Definition at line 216 of file queue.\+c.



Referenced by uart\+\_\+flush().

\index{queue.\+h@{queue.\+h}!queue\+\_\+space@{queue\+\_\+space}}
\index{queue\+\_\+space@{queue\+\_\+space}!queue.\+h@{queue.\+h}}
\subsubsection[{\texorpdfstring{queue\+\_\+space(queue\+\_\+t $\ast$q)}{queue_space(queue_t *q)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf size\+\_\+t} queue\+\_\+space (
\begin{DoxyParamCaption}
\item[{{\bf queue\+\_\+t} $\ast$}]{q}
\end{DoxyParamCaption}
)}\hypertarget{queue_8h_a6309ae001025faf270eb01c0f78c2cba}{}\label{queue_8h_a6309ae001025faf270eb01c0f78c2cba}


Find the amount of free space remaining in the ring buffer. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em $\ast$q} & ring buffer pointer \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
bytes remining in ring buffer 
\end{DoxyReturn}


Definition at line 128 of file queue.\+c.



Referenced by queue\+\_\+full(), and queue\+\_\+push\+\_\+buffer().

\index{queue.\+h@{queue.\+h}!queue\+\_\+used@{queue\+\_\+used}}
\index{queue\+\_\+used@{queue\+\_\+used}!queue.\+h@{queue.\+h}}
\subsubsection[{\texorpdfstring{queue\+\_\+used(queue\+\_\+t $\ast$q)}{queue_used(queue_t *q)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf size\+\_\+t} queue\+\_\+used (
\begin{DoxyParamCaption}
\item[{{\bf queue\+\_\+t} $\ast$}]{q}
\end{DoxyParamCaption}
)}\hypertarget{queue_8h_a3d73971b8454e29803ddc0763a2413c6}{}\label{queue_8h_a3d73971b8454e29803ddc0763a2413c6}


Find the number of bytes used by the ring buffer. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em $\ast$q} & ring buffer pointer \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the number of bytes used in the ring buffer 
\end{DoxyReturn}


Definition at line 102 of file queue.\+c.

